//
// Created by masaikk on 2021/4/19.
//

#ifndef COLK_SOLUTION_H
#define COLK_SOLUTION_H
#include <vector>

class Solution {
public:
    int removeElement(std::vector<int>& nums, int val) {
        int n = nums.size();
        int left = 0;
        for (int right = 0; right < n; right++) {
            if (nums[right] != val) {
                nums[left] = nums[right];
                left++;
            }
        }
        return left;
    }
};


#endif //COLK_SOLUTION_H
